-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for internationalization to the guide #298
Conversation
this is so cool @flpm This is such a huge benefit to us and the community! The one question I have about this is how we maintain when we update things / add new content (and then there are images). On another note - can i invite you to our slack? you have contributed so much !! in case you want to engage there i'd love to invite you. |
Sure, I am happy to join, you can send it to [email protected] I imagine there will be lots of questions, I am happy to help with that. I have the PR as a draft for now while I am sorting out a few last details. |
no problem! i just invited you to slack. and i'm sure this pr will take some time!! have a wonderful weekend and thank you again for all of the work youre doing to help pyOpenSci!! ✨ |
To make this PR easier for review, I will split it into two parts: this one focusing on the set up of the translation workflow, and a new one for the actual Spanish translation. |
7aa2175
to
7655783
Compare
@flpm i'm going to go ahead and merge this as i suspect your second pr will be the one that i can better see what's going on!! thank you for this!! |
This PR adds support for internationalization to the Package Guide as described in issue #287.
See the translation guide in PR #304 for a description of the workflow.
What was done
noxfile.py
to make it easier to maintain as the configuration becomes more complexupdate-translations
: create and update translations files for the languages defined inLANGUAGES
build-translations
: build the guide in the languages defined inLANGUAGES
docs-live-lang
: a convenience session to launch docs-live using a specific language buildbuild-translations-test
: a convenience session to run docs-test using a specific language buildbuild-languages
: a session used bybuild-translations
to build a list of languages (will not be called directly)docs
anddocs-live
sessions to build the language translations defined inRELEASE_LANGUAGES
pyproject.toml
with dev dependencies for translation workflows.po
filesHow to test
nox -s docs
and check that the build is cleannox -s docs-test
and check that the build is cleannox -s docs-live
and check that it works as expected by visitinghttp://localhost:8000
_build/html/es
folder does not exist)nox docs-clean
to delete the build files (check that_build/html
is empty now)nox -s build-translations
locales/es/LC_MESSAGES/
and that this folder now has translation files (.po)locales/es/LC_MESSAGES/index.po
(the file that corresponds to the contents of the guide landing page). Replace the empty string in line 45 with"La guía de paquetes de Python de pyOpenSci"
. You just translated the title of the guide.nox -s build-translations
and verify it has no warnings or errorsnox -s build-translations-test
(apply the parameters from docs-test to build-translations) and verify it has no warnings or errorsnox -s docs-live-lang -- es
and visithttp://localhost:8000
to verify that the title is the Spanish title